package com.yfyszk.kingbird.controller;

import com.netflix.ribbon.proxy.annotation.Http;
import com.yfyszk.kingbird.common.entity.Role;
import com.yfyszk.kingbird.common.result.ApiResult;
import com.yfyszk.kingbird.common.utils.R;
import com.yfyszk.kingbird.service.IRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.Collection;

@Slf4j
@RestController
@RequestMapping("/login")
@CrossOrigin
public class LoginController {
    @Autowired
    private IRoleService roleService;
    @GetMapping(value = "/login")
    public R login(HttpServletRequest request) {
        // Role roles = roleService.getById(1);
        Role roles = roleService.selectRoleById(1l);
         return R.ok().put("0","登录成功");
        //return ApiResult.success(roles);
    }

}
